﻿@model List<Yuebon.Security.Dtos.MenuDto>

@foreach (var menu in Model)
{
    var isActive = ViewBag.CurrentMenuP== menu.EnCode; //判断当前功能是否处于激活

<li class="nav-item @(isActive?"has-treeview menu-open":"")">
    <a href="#" class="nav-link @(isActive?"active":"")"  data-id="@menu.Id">
        <i class="nav-icon @menu.Icon"></i>
        <p>
            @menu.FullName
            <i class="right fa fa-angle-left"></i>
        </p>
    </a>
    <ul class="nav nav-treeview ">
        @foreach (var smenu in menu.SubMenu) {
            isActive = ViewBag.CurrentMenu == smenu.EnCode; //判断当前功能是否处于激活

            <li class="nav-item">
                <a href="@smenu.UrlAddress" data-id="@smenu.Id" class="nav-link @(isActive?"active":"")">
                    <i class="nav-icon @(!string.IsNullOrEmpty(smenu.Icon)?smenu.Icon:"far fa-circle")"></i>
                    <p>@smenu.FullName</p>
                </a>
            </li>
        }
    </ul>
</li>
}
